<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    // new Object() 方法创建
    var person1 = new Object();   //创建了一个新的空的对象
    // 添加属性和方法
    person1.name = "zs";
    person1.age = 18;
    person1.sex = true;
    person1.sayHi = function () {
      console.log("你好");
    };

    var person2 = new Object();   //创建了一个新的空的对象
    // 添加属性和方法
    person1.name = "ls";
    person1.age = 19;
    person1.sex = true;
    person1.sayHi = function () {
      console.log("你好");
    };
    // 输出
    console.log(person1);
  </script>
</head>

<body>

</body>

</html>